<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
  Class: TestUtils
  
    &mdash; Ruby API Doc
  
</title>

  <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />

  <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  hasFrames = window.top.frames.main ? true : false;
  relpath = '';
  framesUrl = "frames.html#!" + escape(window.location.href);
</script>


  <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>

  <script type="text/javascript" charset="utf-8" src="js/app.js"></script>


  </head>
  <body>
    <div id="header">
      <div id="menu">
  
    <a href="_index.html">Index (T)</a> &raquo;
    
    
    <span class="title">TestUtils</span>
  

  <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
</div>

      <div id="search">
  
    <a class="full_list_link" id="class_list_link"
        href="class_list.html">
      Class List
    </a>
  
    <a class="full_list_link" id="method_list_link"
        href="method_list.html">
      Method List
    </a>
  
    <a class="full_list_link" id="file_list_link"
        href="file_list.html">
      File List
    </a>
  
</div>
      <div class="clear"></div>
    </div>

    <iframe id="search_frame"></iframe>

    <div id="content"><h1>Class: TestUtils
  
  
  
</h1>

<dl class="box">
  
    <dt class="r1">Inherits:</dt>
    <dd class="r1">
      <span class="inheritName">Object</span>
      
        <ul class="fullTree">
          <li>Object</li>
          
            <li class="next">TestUtils</li>
          
        </ul>
        <a href="#" class="inheritanceTree">show all</a>
      
      </dd>
    
  
  
    
  
    
  
  
  
    <dt class="r2 last">Defined in:</dt>
    <dd class="r2 last">src/main/api_shim/test_utils.rb</dd>
  
</dl>
<div class="clear"></div>








  
    <h2>
      Class Method Summary
      <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
    </h2>

    <ul class="summary">
      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#buffers_equal-class_method" title="buffers_equal (class method)">+ (Object) <strong>buffers_equal</strong>(buff1, buff2) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#gen_buffer-class_method" title="gen_buffer (class method)">+ (Object) <strong>gen_buffer</strong>(size) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#random_unicode_string-class_method" title="random_unicode_string (class method)">+ (Object) <strong>random_unicode_string</strong>(size) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
    </ul>
  
    <h2>
      Instance Method Summary
      <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
    </h2>

    <ul class="summary">
      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#app_ready-instance_method" title="#app_ready (instance method)">- (Object) <strong>app_ready</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#app_stopped-instance_method" title="#app_stopped (instance method)">- (Object) <strong>app_stopped</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#azzert-instance_method" title="#azzert (instance method)">- (Object) <strong>azzert</strong>(result, message = nil) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#check_thread-instance_method" title="#check_thread (instance method)">- (Object) <strong>check_thread</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#initialize-instance_method" title="#initialize (instance method)">- (TestUtils) <strong>initialize</strong> </a>
    

    
  </span>
  
  
    <span class="note title constructor">constructor</span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>A new instance of TestUtils.</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#register-instance_method" title="#register (instance method)">- (Object) <strong>register</strong>(test_name, &amp;test_handler) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#register_all-instance_method" title="#register_all (instance method)">- (Object) <strong>register_all</strong>(object) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#test_complete-instance_method" title="#test_complete (instance method)">- (Object) <strong>test_complete</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#unregister_all-instance_method" title="#unregister_all (instance method)">- (Object) <strong>unregister_all</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
    </ul>
  

<div id="constructor_details" class="method_details_list">
  <h2>Constructor Details</h2>
  
    <div class="method_details first">
  <h3 class="signature first" id="initialize-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="TestUtils (class)">TestUtils</a></span></tt>) <strong>initialize</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    A new instance of TestUtils

  </div>
</div>
<div class="tags">
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


2
3
4</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'src/main/api_shim/test_utils.rb', line 2</span>

<span class='rubyid_def def kw'>def</span> <span class='rubyid_initialize identifier id'>initialize</span>
  <span class='rubyid_@j_tu ivar id'>@j_tu</span> <span class='assign token'>=</span> <span class='rubyid_org identifier id'>org</span><span class='dot token'>.</span><span class='rubyid_vertx identifier id'>vertx</span><span class='dot token'>.</span><span class='rubyid_java identifier id'>java</span><span class='dot token'>.</span><span class='rubyid_testframework identifier id'>testframework</span><span class='dot token'>.</span><span class='rubyid_TestUtils constant id'>TestUtils</span><span class='dot token'>.</span><span class='rubyid_new identifier id'>new</span><span class='lparen token'>(</span> <span class='rubyid_org identifier id'>org</span><span class='dot token'>.</span><span class='rubyid_vertx identifier id'>vertx</span><span class='dot token'>.</span><span class='rubyid_java identifier id'>java</span><span class='dot token'>.</span><span class='rubyid_platform identifier id'>platform</span><span class='dot token'>.</span><span class='rubyid_impl identifier id'>impl</span><span class='dot token'>.</span><span class='rubyid_JRubyVerticleFactory constant id'>JRubyVerticleFactory</span><span class='dot token'>.</span><span class='rubyid_vertx identifier id'>vertx</span><span class='rparen token'>)</span>
<span class='rubyid_end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
  
</div>


  <div id="class_method_details" class="method_details_list">
    <h2>Class Method Details</h2>

    
      <div class="method_details first">
  <h3 class="signature first" id="buffers_equal-class_method">
  
    + (<tt>Object</tt>) <strong>buffers_equal</strong>(buff1, buff2) 
  

  

  
</h3><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


59
60
61</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'src/main/api_shim/test_utils.rb', line 59</span>

<span class='rubyid_def def kw'>def</span> <span class='rubyid_TestUtils constant id'>TestUtils</span><span class='dot token'>.</span><span class='rubyid_buffers_equal identifier id'>buffers_equal</span><span class='lparen token'>(</span><span class='rubyid_buff1 identifier id'>buff1</span><span class='comma token'>,</span> <span class='rubyid_buff2 identifier id'>buff2</span><span class='rparen token'>)</span>
  <span class='rubyid_org identifier id'>org</span><span class='dot token'>.</span><span class='rubyid_vertx identifier id'>vertx</span><span class='dot token'>.</span><span class='rubyid_java identifier id'>java</span><span class='dot token'>.</span><span class='rubyid_testframework identifier id'>testframework</span><span class='dot token'>.</span><span class='rubyid_TestUtils constant id'>TestUtils</span><span class='dot token'>.</span><span class='rubyid_buffersEqual identifier id'>buffersEqual</span><span class='lparen token'>(</span><span class='rubyid_buff1 identifier id'>buff1</span><span class='dot token'>.</span><span class='rubyid__to_java_buffer identifier id'>_to_java_buffer</span><span class='comma token'>,</span> <span class='rubyid_buff2 identifier id'>buff2</span><span class='dot token'>.</span><span class='rubyid__to_java_buffer identifier id'>_to_java_buffer</span><span class='rparen token'>)</span>
<span class='rubyid_end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="gen_buffer-class_method">
  
    + (<tt>Object</tt>) <strong>gen_buffer</strong>(size) 
  

  

  
</h3><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


50
51
52
53</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'src/main/api_shim/test_utils.rb', line 50</span>

<span class='rubyid_def def kw'>def</span> <span class='rubyid_TestUtils constant id'>TestUtils</span><span class='dot token'>.</span><span class='rubyid_gen_buffer identifier id'>gen_buffer</span><span class='lparen token'>(</span><span class='rubyid_size identifier id'>size</span><span class='rparen token'>)</span>
  <span class='rubyid_j_buff identifier id'>j_buff</span> <span class='assign token'>=</span> <span class='rubyid_org identifier id'>org</span><span class='dot token'>.</span><span class='rubyid_vertx identifier id'>vertx</span><span class='dot token'>.</span><span class='rubyid_java identifier id'>java</span><span class='dot token'>.</span><span class='rubyid_testframework identifier id'>testframework</span><span class='dot token'>.</span><span class='rubyid_TestUtils constant id'>TestUtils</span><span class='dot token'>.</span><span class='rubyid_generateRandomBuffer identifier id'>generateRandomBuffer</span><span class='lparen token'>(</span><span class='rubyid_size identifier id'>size</span><span class='rparen token'>)</span>
  <span class='rubyid_Vertx constant id'>Vertx</span><span class='colon2 op'>::</span><span class='rubyid_Buffer constant id'>Buffer</span><span class='dot token'>.</span><span class='rubyid_new identifier id'>new</span><span class='lparen token'>(</span><span class='rubyid_j_buff identifier id'>j_buff</span><span class='rparen token'>)</span>
<span class='rubyid_end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="random_unicode_string-class_method">
  
    + (<tt>Object</tt>) <strong>random_unicode_string</strong>(size) 
  

  

  
</h3><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


55
56
57</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'src/main/api_shim/test_utils.rb', line 55</span>

<span class='rubyid_def def kw'>def</span> <span class='rubyid_TestUtils constant id'>TestUtils</span><span class='dot token'>.</span><span class='rubyid_random_unicode_string identifier id'>random_unicode_string</span><span class='lparen token'>(</span><span class='rubyid_size identifier id'>size</span><span class='rparen token'>)</span>
  <span class='rubyid_org identifier id'>org</span><span class='dot token'>.</span><span class='rubyid_vertx identifier id'>vertx</span><span class='dot token'>.</span><span class='rubyid_java identifier id'>java</span><span class='dot token'>.</span><span class='rubyid_testframework identifier id'>testframework</span><span class='dot token'>.</span><span class='rubyid_TestUtils constant id'>TestUtils</span><span class='dot token'>.</span><span class='rubyid_randomUnicodeString identifier id'>randomUnicodeString</span><span class='lparen token'>(</span><span class='rubyid_size identifier id'>size</span><span class='rparen token'>)</span>
<span class='rubyid_end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

  <div id="instance_method_details" class="method_details_list">
    <h2>Instance Method Details</h2>

    
      <div class="method_details first">
  <h3 class="signature first" id="app_ready-instance_method">
  
    - (<tt>Object</tt>) <strong>app_ready</strong> 
  

  

  
</h3><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


19
20
21</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'src/main/api_shim/test_utils.rb', line 19</span>

<span class='rubyid_def def kw'>def</span> <span class='rubyid_app_ready identifier id'>app_ready</span>
  <span class='rubyid_@j_tu ivar id'>@j_tu</span><span class='dot token'>.</span><span class='rubyid_appReady identifier id'>appReady</span>
<span class='rubyid_end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="app_stopped-instance_method">
  
    - (<tt>Object</tt>) <strong>app_stopped</strong> 
  

  

  
</h3><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


23
24
25</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'src/main/api_shim/test_utils.rb', line 23</span>

<span class='rubyid_def def kw'>def</span> <span class='rubyid_app_stopped identifier id'>app_stopped</span>
  <span class='rubyid_@j_tu ivar id'>@j_tu</span><span class='dot token'>.</span><span class='rubyid_appStopped identifier id'>appStopped</span>
<span class='rubyid_end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="azzert-instance_method">
  
    - (<tt>Object</tt>) <strong>azzert</strong>(result, message = nil) 
  

  

  
</h3><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


6
7
8
9
10
11
12
13
14
15
16
17</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'src/main/api_shim/test_utils.rb', line 6</span>

<span class='rubyid_def def kw'>def</span> <span class='rubyid_azzert identifier id'>azzert</span><span class='lparen token'>(</span><span class='rubyid_result identifier id'>result</span><span class='comma token'>,</span> <span class='rubyid_message identifier id'>message</span> <span class='assign token'>=</span> <span class='rubyid_nil nil kw'>nil</span><span class='rparen token'>)</span>
  <span class='rubyid_begin begin kw'>begin</span>
    <span class='rubyid_if if kw'>if</span> <span class='rubyid_message identifier id'>message</span>
      <span class='rubyid_@j_tu ivar id'>@j_tu</span><span class='dot token'>.</span><span class='rubyid_azzert identifier id'>azzert</span><span class='lparen token'>(</span><span class='rubyid_result identifier id'>result</span><span class='comma token'>,</span> <span class='rubyid_message identifier id'>message</span><span class='rparen token'>)</span>
    <span class='rubyid_else else kw'>else</span>
      <span class='rubyid_@j_tu ivar id'>@j_tu</span><span class='dot token'>.</span><span class='rubyid_azzert identifier id'>azzert</span><span class='lparen token'>(</span><span class='rubyid_result identifier id'>result</span><span class='rparen token'>)</span>
    <span class='rubyid_end end kw'>end</span>
  <span class='rubyid_rescue rescue kw'>rescue</span> <span class='rubyid_java identifier id'>java</span><span class='dot token'>.</span><span class='rubyid_lang identifier id'>lang</span><span class='dot token'>.</span><span class='rubyid_RuntimeException constant id'>RuntimeException</span>
    <span class='comment val'># Rethrow as a ruby exception so we see nice Ruby backtrace</span>
    <span class='rubyid_raise identifier id'>raise</span> <span class='dstring node'>&quot;Assertion Failed #{message}&quot;</span>
  <span class='rubyid_end end kw'>end</span>
<span class='rubyid_end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="check_thread-instance_method">
  
    - (<tt>Object</tt>) <strong>check_thread</strong> 
  

  

  
</h3><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


63
64
65</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'src/main/api_shim/test_utils.rb', line 63</span>

<span class='rubyid_def def kw'>def</span> <span class='rubyid_check_thread identifier id'>check_thread</span>
  <span class='rubyid_@j_tu ivar id'>@j_tu</span><span class='dot token'>.</span><span class='rubyid_checkThread identifier id'>checkThread</span>
<span class='rubyid_end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="register-instance_method">
  
    - (<tt>Object</tt>) <strong>register</strong>(test_name, &amp;test_handler) 
  

  

  
</h3><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


31
32
33</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'src/main/api_shim/test_utils.rb', line 31</span>

<span class='rubyid_def def kw'>def</span> <span class='rubyid_register identifier id'>register</span><span class='lparen token'>(</span><span class='rubyid_test_name identifier id'>test_name</span><span class='comma token'>,</span> <span class='bitand op'>&amp;</span><span class='rubyid_test_handler identifier id'>test_handler</span><span class='rparen token'>)</span>
  <span class='rubyid_@j_tu ivar id'>@j_tu</span><span class='dot token'>.</span><span class='rubyid_register identifier id'>register</span><span class='lparen token'>(</span><span class='rubyid_test_name identifier id'>test_name</span><span class='comma token'>,</span> <span class='rubyid_test_handler identifier id'>test_handler</span><span class='rparen token'>)</span>
<span class='rubyid_end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="register_all-instance_method">
  
    - (<tt>Object</tt>) <strong>register_all</strong>(object) 
  

  

  
</h3><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


35
36
37
38
39
40
41
42
43
44</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'src/main/api_shim/test_utils.rb', line 35</span>

<span class='rubyid_def def kw'>def</span> <span class='rubyid_register_all identifier id'>register_all</span><span class='lparen token'>(</span><span class='rubyid_object identifier id'>object</span><span class='rparen token'>)</span>
  <span class='rubyid_methods identifier id'>methods</span> <span class='assign token'>=</span> <span class='rubyid_object identifier id'>object</span><span class='dot token'>.</span><span class='rubyid_methods identifier id'>methods</span>
  <span class='rubyid_methods identifier id'>methods</span><span class='dot token'>.</span><span class='rubyid_each identifier id'>each</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_meth identifier id'>meth</span><span class='bitor op'>|</span>
    <span class='rubyid_if if kw'>if</span> <span class='rubyid_meth identifier id'>meth</span><span class='dot token'>.</span><span class='rubyid_to_s identifier id'>to_s</span><span class='dot token'>.</span><span class='rubyid_start_with? fid id'>start_with?</span> <span class='string val'>'test_'</span>
      <span class='rubyid_register identifier id'>register</span><span class='lparen token'>(</span><span class='rubyid_meth identifier id'>meth</span><span class='rparen token'>)</span> <span class='lbrace token'>{</span>
        <span class='rubyid_object identifier id'>object</span><span class='dot token'>.</span><span class='rubyid_method identifier id'>method</span><span class='lparen token'>(</span><span class='rubyid_meth identifier id'>meth</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_call identifier id'>call</span>
      <span class='rbrace token'>}</span>
    <span class='rubyid_end end kw'>end</span>
  <span class='rubyid_end end kw'>end</span>
<span class='rubyid_end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="test_complete-instance_method">
  
    - (<tt>Object</tt>) <strong>test_complete</strong> 
  

  

  
</h3><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


27
28
29</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'src/main/api_shim/test_utils.rb', line 27</span>

<span class='rubyid_def def kw'>def</span> <span class='rubyid_test_complete identifier id'>test_complete</span><span class='lparen token'>(</span><span class='rparen token'>)</span>
  <span class='rubyid_@j_tu ivar id'>@j_tu</span><span class='dot token'>.</span><span class='rubyid_testComplete identifier id'>testComplete</span>
<span class='rubyid_end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="unregister_all-instance_method">
  
    - (<tt>Object</tt>) <strong>unregister_all</strong> 
  

  

  
</h3><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


46
47
48</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'src/main/api_shim/test_utils.rb', line 46</span>

<span class='rubyid_def def kw'>def</span> <span class='rubyid_unregister_all identifier id'>unregister_all</span>
  <span class='rubyid_@j_tu ivar id'>@j_tu</span><span class='dot token'>.</span><span class='rubyid_unregisterAll identifier id'>unregisterAll</span>
<span class='rubyid_end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>

    <div id="footer">
  Generated on Wed Jul 17 20:30:36 2013 by
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
  0.8.6.1 (ruby-1.9.3).
</div>

  </body>
</html>